<template>
	<view class="container">
		<uni-section overflow title="选号杀码" type="line">
			<view class="uni-padding-wrap uni-common-mt">
				<uni-card>
					<uni-badge class="uni-badge-left-margin" :inverted=clickYi text="01" type="success"
						@click="clickCardYi" />
					<uni-badge class="uni-badge-left-margin" :inverted=clickEr text="02" type="success"
						@click="clickCardEr" />
					<uni-badge class="uni-badge-left-margin" :inverted=clickSan text="03" type="success"
						@click="clickCardSan" />
					<uni-badge class="uni-badge-left-margin" :inverted=clickSi text="04" type="success"
						@click="clickCardSi" />
					<uni-badge class="uni-badge-left-margin" :inverted=clickWu text="05" type="success"
						@click="clickCardWu" />
					<uni-badge class="uni-badge-left-margin" :inverted=clickLiu text="06" type="success"
						@click="clickCardLiu" />
					<uni-badge class="uni-badge-left-margin" :inverted=clickQi text="07" type="success"
						@click="clickCardQi" />
					<uni-badge class="uni-badge-left-margin" :inverted=clickBa text="08" type="success"
						@click="clickCardBa" />
					<uni-badge class="uni-badge-left-margin" :inverted=clickJiu text="09" type="success"
						@click="clickCardJiu" />

					<uni-badge class="uni-badge-left-margin" :inverted=click10 text="10" type="success"
						@click="clickCard10" />
					<uni-badge class="uni-badge-left-margin" :inverted=click11 text="11" type="success"
						@click="clickCard11" />
					<uni-badge class="uni-badge-left-margin" :inverted=click12 text="12" type="success"
						@click="clickCard12" />
					<uni-badge class="uni-badge-left-margin" :inverted=click13 text="13" type="success"
						@click="clickCard13" />
					<uni-badge class="uni-badge-left-margin" :inverted=click14 text="14" type="success"
						@click="clickCard14" />
					<uni-badge class="uni-badge-left-margin" :inverted=click15 text="15" type="success"
						@click="clickCard15" />
					<uni-badge class="uni-badge-left-margin" :inverted=click16 text="16" type="success"
						@click="clickCard16" />
					<uni-badge class="uni-badge-left-margin" :inverted=click17 text="17" type="success"
						@click="clickCard17" />
					<uni-badge class="uni-badge-left-margin" :inverted=click18 text="18" type="success"
						@click="clickCard18" />
					<uni-badge class="uni-badge-left-margin" :inverted=click19 text="19" type="success"
						@click="clickCard19" />

					<uni-badge class="uni-badge-left-margin" :inverted=click20 text="20" type="success"
						@click="clickCard20" />
					<uni-badge class="uni-badge-left-margin" :inverted=click21 text="21" type="success"
						@click="clickCard21" />
					<uni-badge class="uni-badge-left-margin" :inverted=click22 text="22" type="success"
						@click="clickCard22" />
					<uni-badge class="uni-badge-left-margin" :inverted=click23 text="23" type="success"
						@click="clickCard23" />
					<uni-badge class="uni-badge-left-margin" :inverted=click24 text="24" type="success"
						@click="clickCard24" />
					<uni-badge class="uni-badge-left-margin" :inverted=click25 text="25" type="success"
						@click="clickCard25" />
					<uni-badge class="uni-badge-left-margin" :inverted=click26 text="26" type="success"
						@click="clickCard26" />
					<uni-badge class="uni-badge-left-margin" :inverted=click27 text="27" type="success"
						@click="clickCard27" />
					<uni-badge class="uni-badge-left-margin" :inverted=click28 text="28" type="success"
						@click="clickCard28" />
					<uni-badge class="uni-badge-left-margin" :inverted=click29 text="29" type="success"
						@click="clickCard29" />

					<uni-badge class="uni-badge-left-margin" :inverted=click30 text="30" type="success"
						@click="clickCard30" />
					<uni-badge class="uni-badge-left-margin" :inverted=click31 text="31" type="success"
						@click="clickCard31" />
					<uni-badge class="uni-badge-left-margin" :inverted=click32 text="32" type="success"
						@click="clickCard32" />
					<uni-badge class="uni-badge-left-margin" :inverted=click33 text="33" type="success"
						@click="clickCard33" />
				</uni-card>
				<view style="padding: 10px;">
					<!-- 以下形式在微信小程序会无效，APP和H5有效  -->
					<u-button type="primary" shape="circle" text="开始分析" @click="submit"></u-button>
				</view>
				<uni-section overflow title="事件流" type="line">
					<u-row >
					    <u-col span="10">
					       <uni-steps :options="list1" :active="active" />
					    </u-col>
					    <u-col span="2">
					      	<u--text text="解释" openType="share" type="error" align="center" @click="show = true"></u--text>
					    </u-col>
					</u-row>
						
				</uni-section>	 
			</view>
			<view>
				<u-popup :show="show" @close="close">
					<uni-section title="A规则" type="line" padding>
						<view>
							<text>杀的号当中15期以内选出出现次数在2到4的两个号，出现次数1的一个号 </text>
						</view>
					</uni-section>
					<uni-section title="B规则" type="line" padding>
						<view>
							<text>没有杀的号当中以15期作为标准选出出现次数5到7的两个号，出现次数2的一个号</text>
						</view>
					</uni-section>
					<uni-section title="C规则" type="line" padding>
						<view>
							<text>直落重号以25期以内作为参考，选出重号次数3到5次的 出一个号</text>
						</view>
					</uni-section>
					<uni-section title="D规则" type="line" padding>
						<view>
							<text>斜连号以15期为准选出次数在2到4次的一个号</text>
						</view>
					</uni-section>
					<uni-section title="E规则" type="line" padding>
						<view>
							<text> 以200期为准 出现次数最少的2个号</text>
						</view>
					</uni-section>
				</u-popup>
			</view>
		</uni-section>
		<uni-section title="最终得到红球" type="line" v-if=" str_ABCDE[0]" padding >
			<text>
				<span v-for="site in str_ABCDE">
					<uni-badge class="uni-badge-left-margin" :text="site" />
				</span>
			</text>
		</uni-section>	
		<uni-section title="规则" type="line" padding>
			<view v-if=" str_A_SanWu[0]">
				<text>A规则 03-05（10期重号）：
					<span v-for="site in str_A_SanWu">
						<text>{{ "    "+site+"    " }}</text>
					</span>
				</text>
			</view>
			<view v-if=" str_A_ErSi[0]">
				<text>A规则 02-04（10期重号）：
					<span v-for="site in str_A_ErSi">
						<text>{{ "    "+site+"    " }}</text>
					</span>
				</text>
			</view>
			<view v-if=" str_B_QiShi[0]">
				<text>B规则 07-10（18期重号）：
					<span v-for="site in str_B_QiShi">
						<text>{{ "    "+site+"    " }}</text>
					</span>
				</text>
			</view>
			<view v-if=" str_B_SiQi[0]">
				<text>B规则 04-07（18期重号）：
					<span v-for="site in str_B_SiQi">
						<text>{{ "    "+site+"    " }}</text>
					</span>
				</text>
			</view>
			<view v-if=" incident_C[0]">
				<text>C规则 03-05（25期直落）：
					<span v-for="site in incident_C">
						<text>{{ "    "+site+"    " }}</text>
					</span>
				</text>
			</view>
			<view v-if=" incident_D[0]">
				<text>D规则 03-05（15期斜连）：
					<span v-for="site in incident_D">
						<text>{{ "    "+site+"    " }}</text>
					</span>
				</text>
			</view>
			<view v-if=" incident_E[0]">
				<text>E规则 (最冷的三个号号码)：
					<span v-for="site in incident_E">
						<text>{{ "    "+site+"    " }}</text>
					</span>
				</text>
			</view>
		</uni-section>
		
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				str_A_SanWu: [], //A杀3到5(10期)
				str_A_ErSi: [], //A杀2到4(10期)
				str_B_QiShi: [], //B 7到10（18期）
				str_B_SiQi: [], //B 4到7（18期）
				incident_C:[],//C 3到5(25期)
				incident_D:[],//D 斜连号3到5(15期)
				incident_E:[],//200期最冷
				str_ABCDE:[],//最终得到红球
				active: -1,
				list1: [{
					title: 'AB规则'
				}, {
					title: 'C规则'
				}, {
					title: 'D规则'
				}, {
					title: 'E规则'
				}],
				title: 'Hello',
				clickLin: true,
				nubmLin: "",

				clickYi: true,
				nubmYi: "",

				clickEr: true,
				nubmEr: "",

				clickSan: true,
				nubmSan: "",

				clickSi: true,
				nubmSi: "",

				clickWu: true,
				nubmWu: "",

				clickLiu: true,
				nubmLiu: "",

				clickQi: true,
				nubmQi: "",

				clickBa: true,
				nubmBa: "",

				clickJiu: true,
				nubmJiu: "",

				click10: true,
				nubm10: "",
				click11: true,
				nubm11: "",
				click12: true,
				nubm12: "",
				click13: true,
				nubm13: "",
				click14: true,
				nubm14: "",
				click15: true,
				nubm15: "",
				click16: true,
				nubm16: "",
				click17: true,
				nubm17: "",
				click18: true,
				nubm18: "",
				click19: true,
				nubm19: "",
				click20: true,
				nubm20: "",
				click21: true,
				nubm21: "",
				click22: true,
				nubm22: "",
				click23: true,
				nubm23: "",
				click24: true,
				nubm24: "",
				click25: true,
				nubm25: "",
				click26: true,
				nubm26: "",
				click27: true,
				nubm27: "",
				click28: true,
				nubm28: "",
				click29: true,
				nubm29: "",
				click30: true,
				nubm30: "",
				click31: true,
				nubm31: "",
				click32: true,
				nubm32: "",
				click33: true,
				nubm33: "",
				IncidentReq: {
					shaNubm: [], //杀号*
					str_A_SanWu: [], //A杀3到5(10期)
					str_A_ErSi: [], //A杀2到4(10期)
					str_B_QiShi: [], //B 7到10（18期）
					str_B_SiQi: [], //B 4到7（18期）
					incident_C:[],//C 3到5(25期)
					incident_D:[],//D 斜连号3到5(15期)
					incident_E:[],//200期最冷
				},
			}
		},
		onLoad() {

		},
		methods: {
			open() {
				// console.log('open');
			},
			close() {
				this.show = false
				// console.log('close');
			},
			/* 改变事件流 */
			change() {
				if (this.active < this.list1.length - 1) {
					this.active += 1
				} else {
					this.active = 0
				}
			},
			async submit() {
				if (this.nubmYi != "") {
					this.IncidentReq.shaNubm.push(this.nubmYi)
				}
				if (this.nubmEr != "") {
					this.IncidentReq.shaNubm.push(this.nubmEr)
				}
				if (this.nubmSan != "") {
					this.IncidentReq.shaNubm.push(this.nubmSan)
				}
				if (this.nubmSi != "") {
					this.IncidentReq.shaNubm.push(this.nubmSi)
				}
				if (this.nubmWu != "") {
					this.IncidentReq.shaNubm.push(this.nubmWu)
				}
				if (this.nubmLiu != "") {
					this.IncidentReq.shaNubm.push(this.nubmLiu)
				}
				if (this.nubmQi != "") {
					this.IncidentReq.shaNubm.push(this.nubmQi)
				}
				if (this.nubmBa != "") {
					this.IncidentReq.shaNubm.push(this.nubmBa)
				}
				if (this.nubmJiu != "") {
					this.IncidentReq.shaNubm.push(this.nubmJiu)
				}
				if (this.nubm10 != "") {
					this.IncidentReq.shaNubm.push(this.nubm10)
				}
				if (this.nubm11 != "") {
					this.IncidentReq.shaNubm.push(this.nubm11)
				}
				if (this.nubm12 != "") {
					this.IncidentReq.shaNubm.push(this.nubm12)
				}
				if (this.nubm13 != "") {
					this.IncidentReq.shaNubm.push(this.nubm13)
				}
				if (this.nubm14 != "") {
					this.IncidentReq.shaNubm.push(this.nubm14)
				}
				if (this.nubm15 != "") {
					this.IncidentReq.shaNubm.push(this.nubm15)
				}
				if (this.nubm16 != "") {
					this.IncidentReq.shaNubm.push(this.nubm16)
				}
				if (this.nubm17 != "") {
					this.IncidentReq.shaNubm.push(this.nubm17)
				}
				if (this.nubm18 != "") {
					this.IncidentReq.shaNubm.push(this.nubm18)
				}
				if (this.nubm19 != "") {
					this.IncidentReq.shaNubm.push(this.nubm19)
				}
				if (this.nubm20 != "") {
					this.IncidentReq.shaNubm.push(this.nubm20)
				}
				if (this.nubm21 != "") {
					this.IncidentReq.shaNubm.push(this.nubm21)
				}
				if (this.nubm22 != "") {
					this.IncidentReq.shaNubm.push(this.nubm22)
				}
				if (this.nubm23 != "") {
					this.IncidentReq.shaNubm.push(this.nubm23)
				}
				if (this.nubm24 != "") {
					this.IncidentReq.shaNubm.push(this.nubm24)
				}
				if (this.nubm25 != "") {
					this.IncidentReq.shaNubm.push(this.nubm25)
				}
				if (this.nubm26 != "") {
					this.IncidentReq.shaNubm.push(this.nubm26)
				}
				if (this.nubm27 != "") {
					this.IncidentReq.shaNubm.push(this.nubm27)
				}
				if (this.nubm28 != "") {
					this.IncidentReq.shaNubm.push(this.nubm28)
				}
				if (this.nubm29 != "") {
					this.IncidentReq.shaNubm.push(this.nubm29)
				}
				if (this.nubm30 != "") {
					this.IncidentReq.shaNubm.push(this.nubm30)
				}
				if (this.nubm31 != "") {
					this.IncidentReq.shaNubm.push(this.nubm31)
				}
				if (this.nubm32 != "") {
					this.IncidentReq.shaNubm.push(this.nubm32)
				}
				if (this.nubm33 != "") {
					this.IncidentReq.shaNubm.push(this.nubm33)
				}
				//发起post方式的请求 AB规则
						this.active = -1,
				uni.request({
					//url:  'http://114.132.55.180:443/sand/chart/selectSanD/coldHot', 
					url: 'http://114.132.55.180:443/shaungseqiu/chart/selecShuangSe/incidentAB',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					data: {
						shaNubm: this.IncidentReq.shaNubm
					},
					method: 'POST',

					success: (res) => {
						this.str_A_SanWu = res.data.str_A_SanWu;
						this.str_A_ErSi = res.data.str_A_ErSi;
						this.str_B_QiShi = res.data.str_B_QiShi;
						this.str_B_SiQi = res.data.str_B_SiQi;
						//更新事件流
						this.change()
						//发起post方式的请求 C规则
						uni.request({
							//url:  'http://114.132.55.180:443/sand/chart/selectSanD/coldHot', 
							url: 'http://114.132.55.180:443/shaungseqiu/chart/selecShuangSe/incidentC',
							header: {
								'content-type': 'application/x-www-form-urlencoded'
							},
							data: {
								shaNubm: this.IncidentReq.shaNubm,
							},
							method: 'POST',
						
							success: (res) => {
								this.incident_C = res.data.incident_C;
								
								//更新事件流
								this.active = 0,
								//发起post方式的请求 D规则
								uni.request({
									//url:  'http://114.132.55.180:443/sand/chart/selectSanD/coldHot', 
									url: 'http://114.132.55.180:443/shaungseqiu/chart/selecShuangSe/incidentD',
									header: {
										'content-type': 'application/x-www-form-urlencoded'
									},
									data: {
										shaNubm: this.IncidentReq.shaNubm
									},
									method: 'POST',
								
									success: (res) => {
										this.incident_D = res.data.incident_D;
										
										//更新事件流
										this.change()
										//发起post方式的请求 E规则
										uni.request({
											//url:  'http://114.132.55.180:443/sand/chart/selectSanD/coldHot', 
											url: 'http://114.132.55.180:443/shaungseqiu/chart/selecShuangSe/incidentE',
											header: {
												'content-type': 'application/x-www-form-urlencoded'
											},
											data: {
												shaNubm: this.IncidentReq.shaNubm
											},
											method: 'POST',
										
											success: (res) => {
												this.incident_E = res.data.incident_E;
												//更新事件流
												this.change()
												//发起post方式的请求 总规则
														uni.request({
															//url:  'http://114.132.55.180:443/sand/chart/selectSanD/coldHot', 
															url: 'http://114.132.55.180:443/shaungseqiu/chart/selecShuangSe/incidentABCDE',
															header: {
																'content-type': 'application/x-www-form-urlencoded'
															},
															data: {
																shaNubm: this.IncidentReq.shaNubm,
																str_A_SanWu:this.str_A_SanWu,
																str_A_ErSi:this.str_A_ErSi,
																str_B_QiShi:this.str_B_QiShi,
																str_B_SiQi:this.str_B_SiQi,
																incident_C:this.incident_C,
																incident_D:this.incident_D,
																incident_E:this.incident_E,
															},
															method: 'POST',
														
															success: (res) => {
																this.str_ABCDE = res.data.str_ABCDE;
																
																//更新事件流
																this.change()
															},
															fail: (res) => {
														
															}
														});
													},
													fail: (res) => {
												
													}
												});
											},
											fail: (res) => {
										
											}
										});
									},
									fail: (res) => {
								
									}
								});
							},
							fail: (res) => {
						
							}
						});
						this.IncidentReq.ShaNubm = []
						
						
				
				
				
			},
			clickCardLin() {
				if (this.clickLin) {
					this.clickLin = false
					this.nubmLin = "0"
				} else {
					this.nubmLin = ""
					this.clickLin = true
				}
			},
			clickCardYi() {
				if (this.clickYi) {
					this.clickYi = false
					this.nubmYi = "1"
				} else {
					this.nubmYi = ""
					this.clickYi = true
				}
			},
			clickCardEr() {
				if (this.clickEr) {
					this.clickEr = false
					this.nubmEr = "2"
				} else {
					this.nubmEr = ""
					this.clickEr = true
				}
			},
			clickCardSan() {
				if (this.clickSan) {
					this.clickSan = false
					this.nubmSan = "3"
				} else {
					this.nubmSan = ""
					this.clickSan = true
				}
			},
			clickCardSi() {
				if (this.clickSi) {
					this.clickSi = false
					this.nubmSi = "4"
				} else {
					this.nubmSi = ""
					this.clickSi = true
				}
			},
			clickCardWu() {
				if (this.clickWu) {
					this.clickWu = false
					this.nubmWu = "5"
				} else {
					this.nubmWu = ""
					this.clickWu = true
				}
			},
			clickCardLiu() {
				if (this.clickLiu) {
					this.clickLiu = false
					this.nubmLiu = "6"
				} else {
					this.nubmLiu = ""
					this.clickLiu = true
				}
			},
			clickCardQi() {
				if (this.clickQi) {
					this.clickQi = false
					this.nubmQi = "7"
				} else {
					this.nubmQi = ""
					this.clickQi = true
				}
			},
			clickCardBa() {
				if (this.clickBa) {
					this.clickBa = false
					this.nubmBa = "8"
				} else {
					this.nubmBa = ""
					this.clickBa = true
				}
			},
			clickCardJiu() {
				if (this.clickJiu) {
					this.clickJiu = false
					this.nubmJiu = "9"
				} else {
					this.nubmJiu = ""
					this.clickJiu = true
				}
			},
			clickCard10() {
				if (this.click10) {
					this.click10 = false
					this.nubm10 = "10"
				} else {
					this.nubm10 = ""
					this.click10 = true
				}
			},
			clickCard11() {
				if (this.click11) {
					this.click11 = false
					this.nubm11 = "11"
				} else {
					this.nubm11 = ""
					this.click11 = true
				}
			},
			clickCard12() {
				if (this.click12) {
					this.click12 = false
					this.nubm12 = "12"
				} else {
					this.nubm12 = ""
					this.click12 = true
				}
			},
			clickCard13() {
				if (this.click13) {
					this.click13 = false
					this.nubm13 = "13"
				} else {
					this.nubm13 = ""
					this.click13 = true
				}
			},
			clickCard14() {
				if (this.click14) {
					this.click14 = false
					this.nubm14 = "14"
				} else {
					this.nubm14 = ""
					this.click14 = true
				}
			},
			clickCard15() {
				if (this.click15) {
					this.click15 = false
					this.nubm15 = "15"
				} else {
					this.nubm15 = ""
					this.click15 = true
				}
			},
			clickCard16() {
				if (this.click16) {
					this.click16 = false
					this.nubm16 = "16"
				} else {
					this.nubm16 = ""
					this.click16 = true
				}
			},
			clickCard17() {
				if (this.click17) {
					this.click17 = false
					this.nubm17 = "17"
				} else {
					this.nubm17 = ""
					this.click17 = true
				}
			},
			clickCard18() {
				if (this.click18) {
					this.click18 = false
					this.nubm18 = "18"
				} else {
					this.nubm18 = ""
					this.click18 = true
				}
			},
			clickCard19() {
				if (this.click19) {
					this.click19 = false
					this.nubm19 = "19"
				} else {
					this.nubm19 = ""
					this.click19 = true
				}
			},
			clickCard20() {
				if (this.click20) {
					this.click20 = false
					this.nubm20 = "20"
				} else {
					this.nubm20 = ""
					this.click20 = true
				}
			},
			clickCard21() {
				if (this.click21) {
					this.click21 = false
					this.nubm21 = "21"
				} else {
					this.nubm21 = ""
					this.click21 = true
				}
			},
			clickCard22() {
				if (this.click22) {
					this.click22 = false
					this.nubm22 = "22"
				} else {
					this.nubm22 = ""
					this.click22 = true
				}
			},
			clickCard23() {
				if (this.click23) {
					this.click23 = false
					this.nubm23 = "23"
				} else {
					this.nubm23 = ""
					this.click23 = true
				}
			},
			clickCard24() {
				if (this.click24) {
					this.click24 = false
					this.nubm24 = "24"
				} else {
					this.nubm24 = ""
					this.click24 = true
				}
			},
			clickCard25() {
				if (this.click25) {
					this.click25 = false
					this.nubm25 = "25"
				} else {
					this.nubm25 = ""
					this.click25 = true
				}
			},
			clickCard26() {
				if (this.click26) {
					this.click26 = false
					this.nubm26 = "26"
				} else {
					this.nubm26 = ""
					this.click26 = true
				}
			},
			clickCard27() {
				if (this.click27) {
					this.click27 = false
					this.nubm27 = "27"
				} else {
					this.nubm27 = ""
					this.click27 = true
				}
			},
			clickCard28() {
				if (this.click28) {
					this.click28 = false
					this.nubm28 = "28"
				} else {
					this.nubm28 = ""
					this.click28 = true
				}
			},
			clickCard29() {
				if (this.click29) {
					this.click29 = false
					this.nubm29 = "29"
				} else {
					this.nubm29 = ""
					this.click29 = true
				}
			},
			clickCard30() {
				if (this.click30) {
					this.click30 = false
					this.nubm30 = "30"
				} else {
					this.nubm30 = ""
					this.click30 = true
				}
			},
			clickCard31() {
				if (this.click31) {
					this.click31 = false
					this.nubm31 = "31"
				} else {
					this.nubm31 = ""
					this.click31 = true
				}
			},
			clickCard32() {
				if (this.click32) {
					this.click32 = false
					this.nubm32 = "32"
				} else {
					this.nubm32 = ""
					this.click32 = true
				}
			},
			clickCard33() {
				if (this.click33) {
					this.click33 = false
					this.nubm33 = "33"
				} else {
					this.nubm33 = ""
					this.click33 = true
				}
			},

		}
	}
</script>

<style>

</style>
